import { MAP_INDEX } from "../Constant"
import { RESTFulDeclare, TYPE } from "../Type"

export function Path(value: string) {
  return (target: any, propertyKey: string, parameterIndex: number) => {
    let types: Map<number, RESTFulDeclare> = target[MAP_INDEX+propertyKey]
    if (!types) {
      types = new Map<number, RESTFulDeclare>()
      target[MAP_INDEX+propertyKey] = types
    }
    types.set(parameterIndex, { type: TYPE.PATH, key: value })
  }
}